class Recent < ActiveRecord::Base
  belongs_to :artifact
  belongs_to :user, :order=>'used_at'
  
  def self.add(artifact,user)
    if artifact.recent.nil?
      artifact.recent = Recent.new(:user_id => user.id) 
    end
    artifact.recent.used_at = Time.now
    artifact.recent.save!
  end
end
